// JavaScript Document
	$(function(){
		//浏览器初始化
		$(".bg").css("width","100%");
		$(".bg").css("height",$(window).height() + "px");
		$(".frameRight").css("width", $(window).width()-166 + "px");
		$(".frameControlHr").css("height","" + $(window).height()-54 + "px");
		$(".frameLeft").css("height","" + $(window).height()-64 + "px");
		
		$(".commTblStyle_1 tbody tr:odd").css("background-color","#f9f9f9");
		$(".pages ul li:first,.pages ul li:last").css("width","80px");
		$(".commInputText300px").css("color","#999999");
		$(".commLeftMenu ul li.close").siblings("li").hide();
		$(".commLeftMenu ul li.title").click(function(){
			$(this).removeClass("close");
			$(this).addClass("open");
			$(this).siblings("li").slideDown("fast");
			$(this).css("background","url("+$path+"/images/common/art/leftMenu.jpg) 0px 0px no-repeat")
			$(this).parents("ul").siblings("ul").children("li").not(".title").slideUp("fast");
			$(this).parents("ul").siblings("ul").children("li.title").removeClass("open")
			$(this).parents("ul").siblings("ul").children("li.title").addClass("close")
		})
		
		//$(".commTblStyle_1 tbody tr").children("td").eq(8).css("background-color","red");
		$(".commTblStyle_1 tbody tr").each(function(index, element) {
            $(this).children("td").eq(8).css("background-color","#FFFFE4");
        });
		$(".commTblStyle_1 tbody tr:even").each(function(index, element) {
            $(this).children("td").eq(9).css("background-color","#FFF4C9");
        });
		$(".commTblStyle_1 tbody tr:even").each(function(index, element) {
            $(this).children("td").eq(10).css("background-color","#FFC9C9");
        });
		$(".commTblStyle_1 tbody tr:odd").each(function(index, element) {
            $(this).children("td").eq(9).css("background-color","#FFF0B2");
        });
		$(".commTblStyle_1 tbody tr:odd").each(function(index, element) {
            $(this).children("td").eq(10).css("background-color","#FFB2B2");
        });
		
		$(".commInputText300px").focus(function(){
			$(this).val("");
			$(this).css("color","#333");
		})
		
		//浏览器窗口大小变化时，窗口自动变化
		$(window).resize(function(){
			$(".bg").css("width","100%");
			$(".bg").css("height",$(window).height() + "px");
			$(".frameRight").css("width", $(window).width()-166 + "px");
			$(".frameControlHr").css("height","" + $(window).height()-54 + "px");
			$(".frameLeft").css("height","" + $(window).height()-64 + "px");
		});
		
		var menuInder = request("menuID");//获取页面的所在一级栏目的ID
			if(menuInder == 0){
					$("#navsList li").eq(0).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px 0px no-repeat");
					$("#navsList li").eq(0).css("color","white");
					$("#navsList li a").eq(0).css("color","white");
					$("#navsList li").eq(0).css("font-weight","bold");
				}
			if(menuInder == 1){
					$("#navsList li").eq(1).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -140px no-repeat");
					$("#navsList li").eq(1).css("color","white");
					$("#navsList li a").eq(1).css("color","white");
					$("#navsList li").eq(1).css("font-weight","bold");
				}
			if(menuInder == 2){
					$("#navsList li").eq(2).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -140px no-repeat");
					$("#navsList li").eq(2).css("color","white");
					$("#navsList li a").eq(2).css("color","white");
					$("#navsList li").eq(2).css("font-weight","bold");
				}
			if(menuInder == 3){
					$("#navsList li").eq(3).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -140px no-repeat");
					$("#navsList li").eq(3).css("color","white");
					$("#navsList li a").eq(3).css("color","white");
					$("#navsList li").eq(3).css("font-weight","bold");
				}
			if(menuInder == 4){
					$("#navsList li").eq(4).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -140px no-repeat");
					$("#navsList li").eq(4).css("color","white");
					$("#navsList li a").eq(4).css("color","white");
					$("#navsList li").eq(4).css("font-weight","bold");
				}
			if(menuInder == 5){
					$("#navsList li").eq(5).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -175px no-repeat");
					$("#navsList li").eq(5).css("color","white");
					$("#navsList li a").eq(5).css("color","white");
					$("#navsList li").eq(5).css("font-weight","bold");
				}
			if(menuInder == 6){
					$("#navsList li").eq(6).css("background","url("+$path+"/images/common/art/navBg.jpg) 0px -175px no-repeat");
					$("#navsList li").eq(6).css("color","white");
					$("#navsList li a").eq(6).css("color","white");
					$("#navsList li").eq(6).css("font-weight","bold");
				}
				
				
			$("#navsList li").mouseover(function(){
				mcancelclosetime();
				var navIndex = $(this).index();
				if(ddmenuitem){
						ddmenuitem.css("display","none");
					}
				ddmenuitem = $("#subMenu_" + navIndex);
				ddmenuitem.css("display","block");
			}).mouseout(function(){
				mclosetime();
				var navIndex = $(this).index();
			})//下拉菜单的展示

		$("#subMenu_1,#subMenu_2,#subMenu_3,#subMenu_4,#subMenu_5,#subMenu_6").mouseover(function(){
				mcancelclosetime();
			}).mouseout(function(){
				mclosetime();
			})//下拉菜单的展示
		
		$(".commTab ul li").click(function(){
			$(".commTab ul li").removeClass("selected");
			$(this).addClass("selected");
			var liIndex = $(this).index();
			$("#commBlock_0,#commBlock_1").hide();
			$("#commBlock_" + liIndex).show();
		})
		
		$(".pages ul li").not(".selected").not(".more").mouseenter(function(){
			$(this).css("background-color","#EFEFEF")
		}).mouseleave(function(){
			$(this).css("background-color","#fff")
		})
		
		$(".commTblStyle_1 tbody tr").mouseenter(function(){
			$(this).addClass("hover");
		}).mouseleave(function(){
			$(this).removeClass("hover");
		})
		
		/**搜索层显隐控制层，鼠标移入移出目标*/
		/*$(".frameControlHr,.frameControlV").live("mouseenter",function(){
			$(this).css("background-color","#137C9B")
		});
		$(".frameControlHr,.frameControlV").live("mouseleave",function(){
			$(this).css("background-color","#C1EBF7")
		});*/
		
		var frameHrStatu = 0;
		var frameVStatu = 0;
		$(".frameControlHr").click(function(){
			if(frameHrStatu == 1){
				$(".frameLeft").css("display","block");
				$(this).children("img").attr("src",$path+"/images/common/art/lineLeft.jpg");
				$(".frameRight").css("width","" + $(window).width()-166 + "px");
				frameHrStatu = 0;
			}else{
				$(".frameLeft").css("display","none");
				$(this).children("img").attr("src",$path+"/images/common/art/lineRight.jpg");
				$(".frameRight").css("width","" + $(window).width()-6 + "px");
				frameHrStatu = 1;
			}
		});
		
		//var defSDivEnterTimeout = null;
		//var defSDivLeaveTimeout = null;
		//搜索层显隐控制，鼠标进入事件
		/*$(".frameControlV").live("mouseenter",function(){
			var $this = $(this);
			//延迟0.5秒，展现搜索层
			defSDivEnterTimeout = setTimeout(function(){
				$this.prev(".defSearchDiv").slideDown("fast");
				$this.children("img").attr("src", $path+"/images/common/art/lineTop.jpg");
			}, 500);
		}).live("mouseleave", function(){
			if(defSDivEnterTimeout != null) {
				//鼠标离开，清除timeout
				clearTimeout(defSDivEnterTimeout);
				defSDivEnterTimeout = null;
			}
			var $this = $(this);
			//延迟0.5秒，屏蔽搜索层
			defSDivLeaveTimeout = setTimeout(function(){
				$this.prev(".defSearchDiv").slideUp("fast");
				$this.children("img").attr("src", $path+"/images/common/art/lineBottom.jpg");
			}, 500);
		});*/
		//搜索层鼠标停留时，不屏蔽搜索层
		/*$(".defSearchDiv").live("mouseenter", function(){
			if(defSDivLeaveTimeout != null) {
				clearTimeout(defSDivLeaveTimeout);
				defSDivLeaveTimeout = null;
			}
		});*/
		//搜索层控件，鼠标离开事件
		/*$(".defSearchDiv").live("mouseleave", function(){
			$(this).slideUp("fast");
		});*/
		
		//搜索层按钮层点击事件
		$(".frameControlV").live("click", function(){
			var defSDiv = $(this).prev(".defSearchDiv");
			if(defSDiv.css("display") === "none") {
				//显示搜索层
				defSDiv.slideDown("fast");
				$(this).children("img").attr("src", $path+"/images/common/art/lineTop.jpg");
			} else {
				//隐藏搜索层
				defSDiv.slideUp("fast");
				$(this).children("img").attr("src", $path+"/images/common/art/lineBottom.jpg");
			}
		});
		
		//自定义页面查询按钮点击事件
		$(".btnDefSearch").live("click", function(){
			var sepShowDiv = $(this).parents(".defSearchDiv").find(".sepShow");
			//如果当前状态为显示全部搜索层内容，查询后屏蔽部分搜索层内容
			if(sepShowDiv.length > 0) {
				opSearchDivDisplay(sepShowDiv); //控制搜索层的展现(局部或全部展现) 
			}
		});
		
		//点击查询，隐藏搜索层
		/*$(".btnDefSearch").live("click", function(){
			var before = $(this).attr("before"); //隐藏搜索层前执行的方法
			var after = $(this).attr("after"); //隐藏搜索层后执行的方法
			if(before) {
				eval(before);
			}
			$(this).parents(".defSearchDiv").slideUp("fast");
			$(this).parents(".defSearchDiv").next(".frameControlV").children("img").attr("src", $path+"/images/common/art/lineBottom.jpg");
			if(after) {
				eval(after);
			}
			//如果左边导航栏打开了，隐藏左边导航栏
			if($(".ui-layout-resizer-west span.content-open").css("display") === 'block') {
				$(".ui-layout-resizer-west span.content-open").click();
			}
		});*/
		
		$(".commSearchBlockTabs ul li").click(function(){
			var liIndex = $(this).index();
			$(this).addClass("selected");
			$(this).siblings("li").removeClass("selected");
			$("#commSearchBlockTabs_0,#commSearchBlockTabs_1").hide();
			$("#commSearchBlockTabs_" + liIndex).show();
		});
		
		
		
	});
	
	function topAndFootTop(){
			var topHtml="<div class='commWidth'>";
			topHtml = topHtml + "<div class='top'>";
			topHtml = topHtml + "<div id='headerLeft'>";
			topHtml = topHtml + "<div id='logo'><img src='"+$path+"/images/common/art/csair.jpg' alt='' /></div>";
			topHtml = topHtml + "</div>";//headerLeft
			topHtml = topHtml + "<div id='headerRight'>";
			topHtml = topHtml + "<div id='loginInfo'>欢迎您回来，黄飞鸿 退出热线电话：0000000000</div>";
			topHtml = topHtml + "<div id='navs'>";
			
			topHtml = topHtml + "<ul id='navsList'>";
            topHtml = topHtml + "<li id='navHome'><a href='index.html?menuID=0'>首  页</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=1'>在线服务</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=2'>产品介绍</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>机型板箱</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=4'>应用下载</a></li>";
			topHtml = topHtml + "<li><a href='index.html?menuID=5'>关于我们</a></li>";
            topHtml = topHtml + "<li id='navSys'><a href='index.html?menuID=6'>联系我们</a></li>";
            topHtml = topHtml + "</ul>";//navsList
			
			topHtml = topHtml + "<div id='subMenu_1'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=1'>在线服务子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=1'>在线服务子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";
			
			topHtml = topHtml + "<div id='subMenu_2'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=2'>产品介绍子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=2'>产品介绍子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";
			
			topHtml = topHtml + "<div id='subMenu_3'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>机型板箱子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>机型板箱子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";
			
			topHtml = topHtml + "<div id='subMenu_4'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>应用下载子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>应用下载子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";

			topHtml = topHtml + "<div id='subMenu_5'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=5'>关于我们子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=5'>关于我们子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";
			
			topHtml = topHtml + "<div id='subMenu_6'>";
            topHtml = topHtml + "<ul>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>联系我们子菜单</a></li>";
            topHtml = topHtml + "<li><a href='index.html?menuID=3'>联系我们子菜单</a></li>";
            topHtml = topHtml + "</ul>";
            topHtml = topHtml + "</div>";
			
			topHtml = topHtml + "</div>";//navs
			topHtml = topHtml + "</div>";//headerRight
			topHtml = topHtml + "</div>";//top
			topHtml = topHtml + "</div>";//commWidth
			document.write(topHtml);
		}
		
		//******************************************

	var timeout         = 500;
	var closetimer		= 0;
	var ddmenuitem      = 0;

	function mclose()
	{
		if(ddmenuitem) ddmenuitem.css("display","none");
	}
	
	function mclosetime()
	{
		closetimer = window.setTimeout(mclose, timeout);
	}
	
	function mcancelclosetime()
	{
		if(closetimer)
		{ 
			window.clearTimeout(closetimer);
			closetimer = null;
		}
	}
	
	//************************
	function request(paras)
    { 
        var url = location.href; 
        var paraString = url.substring(url.indexOf("?")+1,url.length).split("&"); 
        var paraObj = {} 
        for (i=0; j=paraString[i]; i++){ 
        paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length); 
        } 
        var returnValue = paraObj[paras.toLowerCase()]; 
        if(typeof(returnValue)=="undefined"){ 
        return ""; 
        }else{ 
        return returnValue; 
        } 
    }